<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<base href="<%=basePath%>">
<title>总部</title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/bootstrap.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/main.css">
<link rel="stylesheet"
	href="//apps.bdimg.com/libs/jqueryui/1.10.4/css/jquery-ui.min.css">
<script src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/js/main.js"></script>
<script src="${pageContext.request.contextPath}/js/jqueryui.js"></script>
<script src="//apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script src="${pageContext.request.contextPath}/js/MD5.js"></script>
<style>
.main_div {
	min-width: 1000px;
	min-height: 40px
}

.pageChange {
	padding-left: 20px;
	color: #337ab7;
}

.box_content {
	height: 100px;
	padding-left: 30px
}

.pageChange>span {
	cursor: pointer
}

.pageChange>span:hover {
	color: blue
}
.anotherDetaile {
	width: 1200px;
	height: 300px;
	margin: 0 auto
}

.force-overflow1-1 {
	border: none
}

.anotherDetaileButton {
	width: 25%;
	height: 100%;
	float: left;
	text-align: center;
	padding-right:10px
}

</style>
</head>
<body>
	<%@ include file="header.jsp"%>
	<%@ include file="left.jsp"%>
	<div id="index"
		style="position: absolute;left: 180px;top: 80px;bottom: 0;right: 0;">
		<section id="main">
			<div class="scrollbar1-1" id="style1-1">
				<div class="main_div">
					<div class="main_title">
						<span>超市详情</span>
					</div>
				</div>
			</div>
			<div class="force-overflow1-1">
				<div class="superDetaile">
					<form id="uploadForm" class="form-horizontal"
						style="margin-top: 30px" enctype="multipart/form-data">
						<div class="form-group">
							<label class="col-xs-4 control-label">商家名称</label>
							<div class="col-xs-3">
								<input type="text" class="form-control" 
									id="superName" name="name" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-4 control-label">负责人</label>
							<div class="col-xs-3">
								<input type="text" class="form-control" id="superHost"
									 name="principal" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-4 control-label">身份证号</label>
							<div class="col-xs-3">
								<input type="text" class="form-control" id="IDcard"
									 name="identityCard">
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-4 control-label">联系电话</label>
							<div class="col-xs-3">
								<input type="text" class="form-control" id="phone" name="phone"
									 >
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-4 control-label">商家地址</label>
							<div class="col-xs-3">
								<input type="text" class="form-control" id="superAddress"
									 name="address" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-4 control-label">商家经度</label>
							<div class="col-xs-3">
								<input type="text" class="form-control" id="superlongitude"
									 name="longitude" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-xs-4 control-label">商家纬度</label>
							<div class="col-xs-3">
								<input type="text" class="form-control" id="superlatitude"
									 name="latitude" >
							</div>
						</div>
						<div class="anotherDetaile">
							<div class="anotherDetaileButton">
								商家实景
									<img src="" style="width:100%;height:280px" id="image1"
										/>							
							</div>
							<div class="anotherDetaileButton">
								营业执照
									<img src="" style="width:100%;height:280px" id="image2"
										 />
							</div>
							<div class="anotherDetaileButton">
								合同协议
									<img src="" style="width:100%;height:280px" id="image3"
										 />				
							</div>
							<div class="anotherDetaileButton">
								负责人身份证件

									<img src="" style="width:100%;height:280px" id="image4"
										/>
							</div>
						</div>
						<div class="form-group" style="margin-top:20px">
							<div class="col-xs-4 col-xs-offset-3">
								<button onclick="submitSuper()" class="col-xs-3 col-xs-offset-3 btn btn-success"
									type="button">审核通过</button>
										<button onclick="noSuper()" class="col-xs-3 col-xs-offset-3  btn btn-info"
									type="button">审核失败</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</section>


	</div>
	<script>
		$(function() {
			selectinfo()
		})
	
		
	
		function selectinfo() {//加载超市详情
			var URL = document.location.toString();
			var sperIDs = URL.split("=")[1]
			$.post(urls + "seckillAction/getOtherInfoOne",
				{
					id : sperIDs,
				},
				function(data) {
					console.log(data)	
			     	$("#superName").val(data.otherName)
					$("#superHost").val(data.otherPrincipal)	
					$("#IDcard").val(data.otherCard)	
					$("#phone").val(data.otherPhone)	
					$("#superAddress").val(data.otherAdd)	
					$("#superlongitude").val(data.otherLongitude)	
					$("#superlatitude").val(data.otherLatitude)	
					$("#image1").attr("src","/others/"+data.liveAction)	
					$("#image2").attr("src","/others/"+data.license)	
					$("#image3").attr("src","/others/"+data.courier)	
					$("#image4").attr("src","/others/"+data.identityCardImg) 		
				}
				, "json"
			)
		}
		function submitSuper(){//通过审核
		var URL = document.location.toString();
			var sperIDs = URL.split("=")[1]
		 $.post(urls+"otherAction/checkOtherInfo",
		 {
		    id:sperIDs,
		     otherStatus:0
		 },
		 function(res){
		  if(res==true){
		  alert("审核成功")
		  location.href="${pageContext.request.contextPath}/YMGback/head/otherReview.jsp" 
		  }else{
		  alert("操作失败")
		  }
		 }
		 )		 
		}
		function noSuper(){//审核失败
		var URL = document.location.toString();
			var sperIDs = URL.split("=")[1]
		 $.post(urls+"otherAction/deleteOtherInfo",
		 {
		    id:sperIDs,
		 },
		 function(res){
		  if(res==true){
		  alert("该商家未通过审核")
		  location.href="${pageContext.request.contextPath}/YMGback/head/otherReview.jsp" 
		  }else{
		  alert("操作失败")
		  }
		 }
		 )		 
		}
	</script>
</body>
</html>
